package customize

import (
	"gitcode.com/G-YT/baoyou/server/middleware"
	"github.com/gin-gonic/gin"
)

type DrugRouter struct {
}

func (d *DrugRouter) InitDrugRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	drugRouter := Router.Group("drug").Use(middleware.OperationRecord())
	drugRouterWithoutRecord := Router.Group("drug")
	drugRouterWithoutAuth := PublicRouter.Group("drug")
	{
		drugRouter.POST("createDrug", drugApi.CreateDrug)             // 创建药品
		drugRouter.DELETE("deleteDrug", drugApi.DeleteDrug)           // 删除药品
		drugRouter.DELETE("deleteDrugByIds", drugApi.DeleteDrugByIds) // 批量删除药品
		drugRouter.PUT("updateDrug", drugApi.UpdateDrug)              // 更新药品
		drugRouter.POST("setDrugArticle", drugApi.SetDrugArticle)     // 设置药品文章关系
		drugRouter.GET("getDrugArticle", drugApi.GetDrugArticle)      // 获取药品文章关系

	}
	{
		drugRouterWithoutRecord.GET("findDrug", drugApi.FindDrug)       // 根据ID获取药品
		drugRouterWithoutRecord.GET("getDrugList", drugApi.GetDrugList) // 获取药品列表
	}
	{
		drugRouterWithoutAuth.GET("getDrugTypeList", drugApi.GetDrugTypeList)              // 获取药品类型列表
		drugRouterWithoutAuth.POST("getDrugListByParentID", drugApi.GetDrugListByParentID) // 根据ParentID获取药品列表
	}
}
